//
//  FQFillInfoModel.swift
//  SwiftProject
//
//  Created by 董駸 on 2022/8/22.
//

import UIKit
import HandyJSON

enum FillTypeEnum : Int, HandyJSONEnum {
    case text = 0
    case phoneNumber = 1
    case marriage = 2
    case kinsfolk = 3
    case education = 4
    case address = 5
    case jobType = 6
    case business = 7
    case nature = 8
    case companyPhone = 9
    case use = 10
    case liabilities = 11
    case earning = 12
    case city = 14
    case sesame = 15
    case property = 16
    case overdue = 18
    case borrow = 19
    case payoff = 20
    case socialSecurity = 22
    case reservedFunds = 23
    case insurance = 24
}

class FQFillInfoModel: BaseModel {
    var title = ""
    var placeholder = ""
    var type : FillTypeEnum = .text
    var detail = ""
    var code : Int {
        get {
            detailArray.firstIndex(of: detail)!
        }
    }
    var model : FQRegionDataModel!
    
    var detailArray : [String] {
        get {
            switch type {
            case .marriage:
                return ["已婚有子女", "已婚无子女", "未婚", "离异"]
            case .kinsfolk:
                return ["父子", "母子", "兄弟", "姐妹", "夫妻"]
            case .education:
                return ["研究生以上", "大学本科", "大学专科", "高中或中专", "初中及以下"]
            case .jobType:
                return ["上班", "兼职", "企业主", "无业"]
            case .business:
                return ["金融业", "建筑业", "政府机构", "房地产", "教育", "其他行业"]
            case .nature:
                return ["政府或企事业单位", "国企央企", "外资企业", "上市公司", "普通民营企业"]
            case .use:
                return ["购物", "装修", "旅游", "教育", "消费"]
            case .liabilities:
                return ["0-3000", "3000-6000", "6000-10000", "10000-50000", "50000以上"]
            case .earning:
                return ["3000以下", "3000-6000", "6000-10000", "10000-30000", "30000以上"]
            case .sesame:
                return ["600分以下", "601-649分", "650-700分", "700分以上"]
            case .property:
                return ["有公积金", "有车", "有房", "有信用卡", "有京东白条", "有社保", "有花呗", "企业主", "以上都不选"]
            case .overdue:
                return ["信用卡或贷款 存在当前逾期", "一年内无逾期", "一年内有逾期", "信用良好无逾期"]
            case .borrow:
                return ["3-5万", "5-10万", "10-20万"]
            case .payoff:
                return ["无", "转账工资", "银行代发", "部分打卡、部分现金"]
            case .socialSecurity:
                return ["没有缴纳社保", "六个月以下", "六到十二个月", "十二个月以上"]
            case .reservedFunds:
                return ["无公积金", "六个月以下", "六到十二个月", "十二个月以上"]
            case .insurance:
                return ["无", "投保商业保险 两年以下", "投保商业保险 两年以上"]
            default:
                return []
            }
        }
    }
}
